# Maintainer: Robin Candau <antiz@archlinux.org>
# Contributor: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Alexander Fehr <pizzapunk@gmail.com>

pkgname=pychess
pkgver=1.0.4
pkgrel=3
pkgdesc='Chess client'
arch=(any)
url='https://pychess.github.io/'
license=(GPL3)
depends=(gst-plugins-base gtksourceview3 python-cairo python-gobject
         python-ptyprocess python-psutil python-sqlalchemy python-pexpect
         python-websockets)
# /usr/bin/spike is mistaken for a chess engine
conflicts=(spike)
makedepends=(python-build python-installer python-setuptools python-wheel)
source=("https://github.com/pychess/pychess/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('f563a89404746b037f7b3145100a024b7cad83fe1383ad41f55b216c1d09bc5c')

build() {
	cd "${pkgname}-${pkgver}"
	python -m build --wheel --no-isolation
}

package() {
	cd "${pkgname}-${pkgver}"
	python -m installer --destdir="${pkgdir}" dist/*.whl

	# FS#59882
	find "${pkgdir}" -wholename 'external/pexpect' -type d -delete
}
